home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / Macintosh Sample Code / SC.016.OffSample / OffSample.h next >
Encoding:
C/C++ Source or Header  |  1989-03-31  |  5.2 KB  |  151 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    Offscreen Buffer Sample Application
  6. #
  7. #    OffSample
  8. #
  9. #    POffSample.h    -    Rez Include Source
  10. #
  11. #    Copyright © 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:    
  15. #                1.00                04/89
  16. #
  17. #    Components:
  18. #                OffSample.p            April 1, 1989
  19. #                OffSample.r            April 1, 1989
  20. #                OffSample.h            April 1, 1989
  21. #                POffSample.make        April 1, 1989
  22. #
  23. #    Requirements:
  24. #                Offscreen.p            April 1, 1989
  25. #                Offscreen.inc1.p    April 1, 1989
  26. #                UFailure.p            November 1, 1988
  27. #                UFailure.inc1.p        November 1, 1988
  28. #                UFailure.a            November 1, 1988
  29. #
  30. #    OffSample demonstrates the usage of the Offscreen
  31. #    unit. It shows how to use offscreen pixmaps and
  32. #    bitmaps to produce flicker-free updating with a
  33. #    minimum of re-structuring of code. OffSample attempts
  34. #    to reduce the amount of 'knowledge' that it has of
  35. #    the offscreen structure so as to minimize its
  36. #    dependence on that unit.
  37. #
  38. #    OffSample emphasizes using the Offscreen unit; it
  39. #    is not intended to be viewed as a complete application
  40. #    from which to base some larger effort. Instead, its
  41. #    method of using offscreen bitmaps and pixmaps should
  42. #    be studied and adapted to other applications that
  43. #    desire features such as flicker-free updating.
  44. #
  45. ------------------------------------------------------------------------------*/
  46.  
  47. #define kMinSize                75        /* application's minimum size (in K) */
  48.  
  49. #define kPrefSize                245        /* application's preferred size (in K) */
  50.  
  51. #define    rMenuBar                128        /* application's menu bar */
  52. #define    rAboutAlert                128        /* about alert */
  53. #define    rUserAlert                129        /* error user alert */
  54. #define    rWindow                    128        /* application's window */
  55.  
  56. /* kSysEnvironsVersion is passed to SysEnvirons to tell it which version of the
  57.    SysEnvRec we understand. */
  58.  
  59. #define    kSysEnvironsVersion        1
  60.  
  61. /* kOSEvent is the event number of the suspend/resume and mouse-moved events sent
  62.    by MultiFinder. Once we determine that an event is an osEvent, we look at the
  63.    high byte of the message sent to determine which kind it is. To differentiate
  64.    suspend and resume events we check the resumeMask bit. */
  65.  
  66. #define    kOSEvent                app4Evt    /* event used by MultiFinder */
  67. #define    kSuspendResumeMessage    1        /* high byte of suspend/resume event message */
  68. #define    kResumeMask                1        /* bit of message field for resume vs. suspend */
  69. #define    kMouseMovedMessage        0xFA    /* high byte of mouse-moved event message */
  70.  
  71. #define    sErrStrings                128
  72.  
  73. #define    kNoBackBuff                128
  74. #define    kNoEditBuff                129
  75. #define    kTitle                    130
  76. #define    kColorPrompt            131
  77. #define    kNoWantBack                132
  78. #define    kNoWantEdit                133
  79.  
  80. /* The following constants are used to identify menus and their items. The menu IDs
  81.    have an "m" prefix and the item numbers within each menu have an "i" prefix. */
  82.  
  83. #define    mApple                    128        /* Apple menu */
  84. #define    iAbout                    1
  85.  
  86. #define    mFile                    129        /* File menu */
  87. #define    iNew                    1
  88. #define    iClose                    4
  89. #define    iQuit                    12
  90.  
  91. #define    mEdit                    130        /* Edit menu */
  92. #define    iUndo                    1
  93. #define    iCut                    3
  94. #define    iCopy                    4
  95. #define    iPaste                    5
  96. #define    iClear                    6
  97.  
  98. #define    mShape                    131        /* Shape menu */
  99.  
  100. #define mSpecial                132        /* Special menu */
  101. #define iUseBack                1
  102. #define iUseEdit                2
  103. #define iPickColor                4
  104.  
  105. /*    kTopLeft - This is for positioning the Disk Initialization dialogs. */
  106.  
  107. #define kDITop                    0x0050
  108. #define kDILeft                    0x0070
  109.  
  110. /*    kMinHeap - This is the minimum result from the following equation:
  111.         
  112.         ORD(GetApplLimit) - ORD(ApplicZone)
  113.         
  114.     for the application to run. It will insure that enough memory will
  115.     be around for reasonable-sized scraps, FKEYs, etc. to exist with the
  116.     application, and still give the application some 'breathing room'.
  117.     To derive this number, we ran under a MultiFinder partition that was
  118.     our requested minimum size, as given in the 'SIZE' resource. */
  119.      
  120. #define kMinHeap                66 * 1024
  121.     
  122. /*    kMinSpace - This is the minimum result from PurgeSpace, when called
  123.     at initialization time, for the application to run. This number acts
  124.     as a double-check to insure that there really is enough memory for the
  125.     application to run, including what has been taken up already by
  126.     pre-loaded resources, the scrap, code, and other sundry memory blocks. */
  127.      
  128. #define kMinSpace                49 * 1024
  129.  
  130. /* kExtremeNeg and kExtremePos are used to set up wide open rectangles and regions. */
  131.  
  132. #define kExtremeNeg                -32768
  133. #define kExtremePos                32767 - 1 /* required to address an old region bug */
  134.  
  135. /* these #defines are used to set enable/disable flags of a menu */
  136.  
  137. #define AllItems    0b1111111111111111111111111111111    /* 31 flags */
  138. #define NoItems        0b0000000000000000000000000000000
  139. #define MenuItem1    0b0000000000000000000000000000001
  140. #define MenuItem2    0b0000000000000000000000000000010
  141. #define MenuItem3    0b0000000000000000000000000000100
  142. #define MenuItem4    0b0000000000000000000000000001000
  143. #define MenuItem5    0b0000000000000000000000000010000
  144. #define MenuItem6    0b0000000000000000000000000100000
  145. #define MenuItem7    0b0000000000000000000000001000000
  146. #define MenuItem8    0b0000000000000000000000010000000
  147. #define MenuItem9    0b0000000000000000000000100000000
  148. #define MenuItem10    0b0000000000000000000001000000000
  149. #define MenuItem11    0b0000000000000000000010000000000
  150. #define MenuItem12    0b0000000000000000000100000000000
  151.